package morning.cat.mybatis.plus.sample.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @describe: 类描述信息
 * @author: morningcat.zhang
 * @date: 2019/2/10 3:16 AM
 */
@Data
@ToString
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName(value = "t_user")
public class User extends Model<User> {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField(value = "t_name")
    private String name;

    /**
     * 默认就是 age ,可省略
     */
    //@TableField(value = "age")
    private Integer age;


    private UserStatus status;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
